< previous page page_218 next page >

Page 218
#endif
    RASCS_SubEntryConnected,
    RASCS_SubEntryDisconnected,

    RASCS_Interactive = RASCS PAUSED,
    RASCS_RetryAuthentication,
    RASCS_CallbackSetByCaller,
    RASCS_PasswordExpired,

    RASCS_Connected = RASCS_DONE,
    RASCS_Disconnected
};
It's true that I've offered no guidance on how to interpret this code, either in the puzzle or the tutorials (found in Part III). But unfair? I think not. Part of the intent of this book is to encourage, even force, you to think creatively when facing difficult problems. Since it is impossible for this book (or any other) to cover every API problem you will face with Visual Basic, it is important that you learn to apply knowledge you already have to new problems.
You may know nothing about C enumerations, but you should know quite a bit about Visual Basic enumerations created using the Enum statement. In a Visual Basic enumeration, every variable within the enumeration receives either a value that is assigned explicitly or one greater than the previous variable. The C structure you see here also uses the keyword ''enum." Some of the variables are assigned explicitly, others have no assignment. Sound familiar? Take a look at the Visual Basic code that follows and compare it to the C code:
Private Const RASCS_PAUSED = &H1000
Private Const RASCS_DONE = &H2000

Private Enum RasConnState
    RASCS_OpenPort = 0
    RASCS_PortOpened
    RASCS_ConnectDevice
    RASCS_DeviceConnected
    RASCS_AllDevicesConnected
    RASCS_Authenticate
    RASCS_AuthNotify
    RASCS_AuthRetry
    RASCS_AuthCallback
    RASCS_AuthChangePassword
    RASCS_AuthProject
    RASCS_AuthLinkSpeed

 
< previous page page_218 next page >